package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Genotypes generated by hbm2java
 */
@Entity
@Table(name="genotypes"
    ,catalog="madr_bd10"
)
public class Genotypes  implements java.io.Serializable {


     private Integer idGen;
     private CropsTypes cropsTypes;
     private String nameGen;
     private String codeGen;
     private Boolean statusGen;
     private Set seedsColorses = new HashSet(0);
     private Set sowings = new HashSet(0);
     private Set growingEnvironments = new HashSet(0);

    public Genotypes() {
    }

    public Genotypes(CropsTypes cropsTypes, String nameGen, String codeGen, Boolean statusGen, Set seedsColorses, Set sowings, Set growingEnvironments) {
       this.cropsTypes = cropsTypes;
       this.nameGen = nameGen;
       this.codeGen = codeGen;
       this.statusGen = statusGen;
       this.seedsColorses = seedsColorses;
       this.sowings = sowings;
       this.growingEnvironments = growingEnvironments;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_gen", unique=true, nullable=false)
    public Integer getIdGen() {
        return this.idGen;
    }
    
    public void setIdGen(Integer idGen) {
        this.idGen = idGen;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="crop_type_gen")
    public CropsTypes getCropsTypes() {
        return this.cropsTypes;
    }
    
    public void setCropsTypes(CropsTypes cropsTypes) {
        this.cropsTypes = cropsTypes;
    }
    
    @Column(name="name_gen", length=45)
    public String getNameGen() {
        return this.nameGen;
    }
    
    public void setNameGen(String nameGen) {
        this.nameGen = nameGen;
    }
    
    @Column(name="code_gen", length=45)
    public String getCodeGen() {
        return this.codeGen;
    }
    
    public void setCodeGen(String codeGen) {
        this.codeGen = codeGen;
    }
    
    @Column(name="status_gen")
    public Boolean getStatusGen() {
        return this.statusGen;
    }
    
    public void setStatusGen(Boolean statusGen) {
        this.statusGen = statusGen;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="genotypes_colors", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_genotype_gen_col", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_seed_color_gen_col", nullable=false, updatable=false) })
    public Set getSeedsColorses() {
        return this.seedsColorses;
    }
    
    public void setSeedsColorses(Set seedsColorses) {
        this.seedsColorses = seedsColorses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="genotypes")
    public Set getSowings() {
        return this.sowings;
    }
    
    public void setSowings(Set sowings) {
        this.sowings = sowings;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="genotypes_growing_environments", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_genotype_gen_gro_env", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_growing environment_gen_gro_env", nullable=false, updatable=false) })
    public Set getGrowingEnvironments() {
        return this.growingEnvironments;
    }
    
    public void setGrowingEnvironments(Set growingEnvironments) {
        this.growingEnvironments = growingEnvironments;
    }




}


